#!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.views.decorators.cache import cache_page
from django.contrib.sitemaps import views as sitemap_views
from django.conf.urls.defaults import patterns, include, url
from Sitemap.sitemaps import GenericSitemap, GoogleNews, Sitemap

sitemaps_googlenews = {
    'articles': GenericSitemap(GoogleNews(), priority=0.6),
}

sitemaps_tudo = {
    'articles': GenericSitemap(Sitemap(), priority=0.6),
}

urlpatterns = patterns(
    '',
    url(r'^-googlenews\.xml$', cache_page(86400)(sitemap_views.sitemap),
        {'sitemaps': sitemaps_googlenews,
         'template_name': 'extras/sitemaps/sitemap_googlenews.xml'}),

    url(r'^-sitemap\.xml$', cache_page(86400)(sitemap_views.sitemap),
        {'sitemaps': sitemaps_tudo,
         'template_name': 'extras/sitemaps/sitemap.xml'}),
)
